<?
require("config.php");

$location_status .= "| Setting";
$show_backnav = "news_menu";
$menuname = NULL;
$menutarget = NULL;
$ary = array('shipping_free' => 'Free Shipping Value');

if (NULL!=$action){
    foreach($ary as $k => $v)
	{
		$field = array('vkey','val','createtime');
		$content = array($k,$_POST[$k],time());
		$exp = "vkey='".$k."'";
   		myUpdate($table,$field,$content,$exp);
	}
   

   header("location:" . $rela_path . "share/msg.php?v=9009");

   exit();

}


$Query = "SELECT vkey,val FROM $table order by createtime";
$r=myQuery($Query);

if(empty($r))
{
	foreach($ary as $k => $v)
	{
		$vals =  array('vkey' => $k, 'val' => '0', 'createtime' => time());
   		myInsert($table, array_keys($vals), array_values($vals));
		$r[] = $vals;
	}
}
require($rela_path . "inc/header.php");
require($rela_path . "bin/date.php");

?>



<form action="" method="post" enctype="multipart/form-data" name="form1">
<input name="action" type="hidden" value="edit">
<input name="Code" type="hidden" value="<?print($Code)?>">
<input name="old_Picture" type="hidden" value="<?print($Picture)?>">




<table width="95%" border="0" align="center">
  <tr> 
    <td valign="top"> <table border="0" cellspacing="5" cellpadding="1">
          <tr> 
            <td width="200">&nbsp;</td>
            <td width="243">&nbsp;</td>
          </tr>
		  <?php foreach($r  as $k => $v){;?>
          <tr> 
            <td align="right" class="tdheader"><?=$ary[$v[0]]?>  : </td>
            <td><input type="text" class="text" name="<?=$v[0]?>" size="40" value="<?=$v[1]?>"></td>
          </tr>
          <?php }?>
          <tr> 
            <td>&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
          <tr> 
            <td>&nbsp;</td>
            <td> <input type="image" src="../../images/bt_cancel.gif" onClick="Redirect('news_menu.php',1);return false;"> <input type="image" src="../../images/bt_save.gif">            </td>
          </tr>
          <tr> 
            <td>&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
        </table>
    </td>

  </tr>
</table>
<br>
<br>
<br>


</form>

<?
require($rela_path . "inc/footer.php");
?>
